<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const canvas = document.createElement('canvas')
        canvas.width = 600
        canvas.height = 600
        document.body.appendChild(canvas)

        const ctx = canvas.getContext('2d')
        ctx.fillRect(100,100,50,50)
    </script>
</body>
</html>